package com.jilian.mydemo.modul.order.repositoty;


import android.arch.lifecycle.LiveData;

import com.jilian.mydemo.api.Api;
import com.jilian.mydemo.base.BaseDto;
import com.jilian.mydemo.base.CommonRepository;
import com.jilian.mydemo.city.bean.ProvinceBean;
import com.jilian.mydemo.common.dto.AccountDto;
import com.jilian.mydemo.common.dto.CommitOrderDto;
import com.jilian.mydemo.common.dto.EvaluateDto;
import com.jilian.mydemo.common.dto.FinishImgDto;
import com.jilian.mydemo.common.dto.FinishPayDto;
import com.jilian.mydemo.common.dto.MemberDto;
import com.jilian.mydemo.common.dto.OrderDetailDto;
import com.jilian.mydemo.common.dto.OrderListDto;
import com.jilian.mydemo.common.dto.ParamsListDto;
import com.jilian.mydemo.common.dto.PerformDto;
import com.jilian.mydemo.common.dto.PerformListDto;
import com.jilian.mydemo.common.dto.PlanPathListDto;
import com.jilian.mydemo.common.dto.ProductDetailDto;
import com.jilian.mydemo.common.dto.ServiceProcessDto;
import com.jilian.mydemo.common.dto.ShopListDto;
import com.jilian.mydemo.common.vo.AddProductToOrderVo;
import com.jilian.mydemo.common.vo.DelayNoticeVo;
import com.jilian.mydemo.common.vo.FinishImgVo;
import com.jilian.mydemo.common.vo.FinishOrderVo;
import com.jilian.mydemo.common.vo.FinishPayVo;
import com.jilian.mydemo.common.vo.MemberVo;
import com.jilian.mydemo.common.vo.OrderVo;
import com.jilian.mydemo.common.vo.PerformanceVo;
import com.jilian.mydemo.common.vo.PhotoVerifyVo;
import com.jilian.mydemo.common.vo.ProductToShoppingCartVo;
import com.jilian.mydemo.common.vo.ReportOrderVo;
import com.jilian.mydemo.common.vo.ServiceAreaVo;
import com.jilian.mydemo.common.vo.SubscribeVo;
import com.jilian.mydemo.common.vo.UpdateShopCartVo;
import com.jilian.mydemo.common.vo.UpdateWorkVo;
import com.jilian.mydemo.common.vo.VisitSignVo;
import com.jilian.mydemo.common.vo.WithdrawCountVo;
import com.jilian.mydemo.common.vo.WithdrawOrderVo;
import com.jilian.mydemo.common.vo.WithdrawVo;

import java.io.File;
import java.util.List;


public class OrderRepository extends CommonRepository {
    /**
     * 订单列表
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<OrderListDto>> query(OrderVo vo) {
        return request(Api.query(vo)).send().get();
    }

    /**
     * 抢单
     *
     * @return
     */
    public LiveData<BaseDto> grabOrder(OrderVo vo) {
        return request(Api.grabOrder(vo)).send().get();
    }

    /**
     * 填写预约信息
     *
     * @return
     */
    public LiveData<BaseDto> subscribe(SubscribeVo vo) {
        return request(Api.subscribe(vo)).send().get();
    }

    /**
     * 延时提醒
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> delayNotice(DelayNoticeVo vo) {
        return request(Api.delayNotice(vo)).send().get();
    }

    /**
     * 查看服务进程
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<List<ServiceProcessDto>>> serviceProcess(OrderVo vo) {
        return request(Api.serviceProcess(vo)).send().get();
    }

    /**
     * 上门签到
     *
     * @param vo
     * @param files
     * @return
     */
    public LiveData<BaseDto> visitSign(VisitSignVo vo, List<File> files) {
        return request(Api.visitSign(vo, files, "*/*")).send().get();

    }

    /**
     * 水工报单
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> reportOrder(ReportOrderVo vo, List<File> files) {
        return request(Api.reportOrder(vo, files, "*/*")).send().get();
    }

    /**
     * 退单
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> withdrawOrder(WithdrawOrderVo vo) {
        return request(Api.withdrawOrder(vo)).send().get();
    }

    /**
     * 退单次数
     * @param
     * @return
     */
    public LiveData<BaseDto<String>> withdrawCount(WithdrawCountVo vo) {
        return request(Api.withdrawCount(vo)).send().get();
    }




    /**
     * 订单详情
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<OrderDetailDto>> queryDetail(OrderVo vo) {
        return request(Api.queryDetail(vo)).send().get();
    }

    /**
     * 水工绩效
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<PerformListDto>> performance(PerformanceVo vo) {
        return request(Api.performance(vo)).send().get();
    }

    /**
     * 水工评分
     *
     * @return
     */
    public LiveData<BaseDto<EvaluateDto>> evaluate() {
        return request(Api.evaluate()).send().get();
    }

    /**
     * 多人水工
     *
     * @return
     */
    public LiveData<BaseDto<List<MemberDto>>> queryMember(MemberVo vo) {
        return request(Api.queryMember(vo)).send().get();
    }

    /**
     * 设置水工工作量
     *
     * @return
     */
    public LiveData<BaseDto> updateWork(UpdateWorkVo vo) {
        return request(Api.updateWork(vo)).send().get();
    }

    /**
     * 工单地图
     *
     * @return
     */
    public LiveData<BaseDto<PlanPathListDto>> planPath() {
        return request(Api.planPath()).send().get();
    }

    /**
     * 上传凭据（表单提交）
     *
     * @return
     */
    public LiveData<BaseDto<List<FinishImgDto>>> uploadFinishImg(FinishImgVo vo, List<File> files) {

        return request(Api.uploadFinishImg(vo, files, "*/*")).send().get();
    }

    /**
     * 完成支付
     *
     * @param vo
     * @param files
     * @return
     */
    public LiveData<BaseDto<FinishPayDto>> finishPay(FinishPayVo vo, List<File> files) {
        return request(Api.finishPay(vo, files, "*/*")).send().get();
    }


    /**
     * 获取服务列表
     *
     * @return
     */
    public LiveData<BaseDto<List<ProvinceBean>>> queryAllOffice() {
        return request(Api.queryAllOffice()).send().get();
    }

    /**
     * 订单完成填写接口
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> finishOrder(FinishOrderVo vo) {
        return request(Api.finishOrder(vo)).send().get();
    }

    /**
     * 提交订单到支付
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<Long>> commitOrder(OrderVo vo) {
        return request(Api.commitOrder(vo)).send().get();
    }


    /**
     * 添加到购物车
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> addProductToShoppingCart(ProductToShoppingCartVo vo) {
        return request(Api.addProductToShoppingCart(vo)).send().get();
    }

    /**
     * 查询购物车
     *
     * @return
     */
    public LiveData<BaseDto<List<ProductDetailDto>>> getShoppingCartProducts() {
        return request(Api.getShoppingCartProducts()).send().get();
    }

    /**
     * 购物车-修改对应的购物车
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> updateShopCart(UpdateShopCartVo vo) {
        return request(Api.updateShopCart(vo)).send().get();
    }


    /**
     * 购物车-添加到订单
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto> addProductToOrder(AddProductToOrderVo vo) {
        return request(Api.addProductToOrder(vo)).send().get();
    }

    /**
     * 检查支付状态
     *
     * @param vo
     * @return
     */
    public LiveData<BaseDto<String>> checkPayStatus(OrderVo vo) {
        return request(Api.checkPayStatus(vo)).send().get();
    }

    /**
     * 完成订单页面-初始化参数
     *
     * @return
     */
    public LiveData<BaseDto<ParamsListDto>> initParams() {
        return request(Api.initParams()).send().get();
    }


    /**
     * 我的钱包
     *
     * @return
     */
    public LiveData<BaseDto<AccountDto>> account() {
        return request(Api.account()).send().get();
    }

    /**
     * 提现
     *
     * @return
     */
    public LiveData<BaseDto> withdraw(WithdrawVo vo) {
        return request(Api.withdraw(vo)).send().get();
    }

    /**
     * 报单-下拉參數
     *
     * @return
     */
    public LiveData<BaseDto<ParamsListDto>> reportInitParam() {
        return request(Api.reportInitParam()).send().get();
    }


    /**
     * 判断是否已经签到
     * @return
     */
    public LiveData<BaseDto<String>> checkSign(OrderVo vo) {
        return request(Api.checkSign(vo)).send().get();
    }




}
